package com.argticling.service;

import java.util.List;

import com.argticling.dao.interf.ContactDAO;
import com.argticling.model.chanel.Contact;
import com.argticling.model.chanel.ContactTypeEnum;

public class ContactService {
    private ContactDAO contactDao;

    public void delete(Contact contact) {
        contactDao.delete(contact);
    }

    public void persist(Contact contact) {
        contactDao.persist(contact);
    }

    public ContactDAO getContactDao() {
        return contactDao;
    }

    public List<Contact> getFacebookContacts() {
        return contactDao.getContactsByType(ContactTypeEnum.FACEBOOK.toString());
    }

    public List<Contact> getTwitterContacts() {
        return contactDao.getContactsByType(ContactTypeEnum.TWITTER.toString());
    }

    public List<Contact> getEmailContacts() {
        return contactDao.getContactsByType(ContactTypeEnum.EMAIL.toString());
    }

    public void setContactDao(ContactDAO contactDao) {
        this.contactDao = contactDao;
    }

    public Contact getContactById(String id) {
        return contactDao.getContactById(id);
    }
}
